home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_commie_elevswitch.cog < prev    next >
Text File  |  1999-11-15  |  18KB  |  674 lines

  1. # Jones 3D Cog Script
  2. #
  3. # vol_Commie_ElevSwitch.cog
  4. #
  5. # This elevator will come down to frame one, sleep, then return to frame 0.
  6. #
  7. # [CM & revised by HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. symbols
  13.     
  14. #...............MESSAGES.................
  15.     message        startup
  16.     message        activated
  17.     message        arrived
  18.     message        entered
  19.     message        exited
  20.     message        blocked
  21.  
  22. #...............ROUTINES.................
  23.     flex    elev_up                                            local
  24.     flex    elev_down                                        local
  25.     flex    cutscene_up                                        local
  26.     flex    cutscene_down                                    local
  27.  
  28. #...............ACTORS...................
  29.     thing    player                                            local
  30.     thing    indyActor                                        
  31.     thing   deadIndy                                        local
  32.     
  33.     thing    commie0
  34.     thing    commie1
  35.     thing    commie2
  36.     thing    commie3
  37.  
  38.  
  39. #...............ACTOR MARKS..............
  40.     thing    elev_INMV0
  41.     thing    elev_INMV1
  42.     
  43.     thing    elev_INFLEEMK0
  44.     thing    elev_INFLEEMK1
  45.  
  46.     thing    comMV0
  47.     thing    comMV1
  48.     thing    comMV2
  49.     thing    comMV3
  50.     
  51.     
  52. #...............ACTOR LOOK TARGETS.......
  53.     thing    elev_INLK0
  54.     thing    elev_INLK1
  55.  
  56. #...............CAMERAS..................
  57.     thing    topcam
  58.     thing    bottomcam
  59.     thing    finalCam
  60.  
  61. #...............PROPS..............
  62.     thing        elevator         
  63.     thing        button0            
  64.     thing        button1            
  65.     thing        winch            
  66.     thing        animatedwinch            
  67.         
  68.     
  69.     thing        cable_start                                                # startingpoint for the polyline cable            
  70.     thing        cable_end                                                # endpoint for the polyline cable            
  71.     
  72.     surface        groundkill                                    
  73.  
  74. #...............KEYFRAMES..............
  75.     keyframe    winchrun=vol_winch_up.key                    local    
  76.     keyframe    winchrun_dn=vol_winch_down.key                local
  77.     keyframe    inDie=in_die_buckle.key                     local
  78.     keyframe    in_bothup=0in_armsup_1_1.key                local
  79.  
  80. #...............MATERIALS..............
  81.     material    boxfront=box_aswitch_frnt.mat                local
  82.     material    cableskin=riv_floor_metal.mat                local
  83.  
  84. #...............VARIABLES..............
  85.     vector        v_camspot                                    local
  86.     flex        start_wait=1.5                               local        # pause_before_moving_up
  87.     flex        sleeptime=4.0                                local
  88.     flex        speed=3.0                                    local
  89.     flex        rotref                                        local        # store maxrotvel of the indy actor
  90.     int            com_rush=0                                    local        # control var for the commies rush attack
  91.     int            winchKey                                    local        # channel for winch keyframe
  92.     int            i                                            local        # for loops
  93.     int            hit=0                                        local        # for non-repetition
  94.     int            in_thespot=0                                local        # for cutscene aspect of elevator motion
  95.     
  96.     int         grnd_spot=0                                   local        # if indy enters the ground below the elevator
  97.     int         deadMan=0                                   local        # if indy dies
  98.     int         victim                                      local
  99.     int         elev_dir=0                                  local        # 1 for down, 0 for up
  100.     int            btn_colltype                                local
  101.  
  102. #...............TEMPLATES..............
  103.     template    tpl_Indy=indy_sh_actor                      local
  104.         
  105. #...............SOUNDS..............
  106.     sound        switch=sol_panel_switch_c.wav                local
  107.     sound        terror_cue=mus_gen_russbold_shrt1.wav        local
  108.     sound       sndDie=tem_temspikes_up_kill_c.wav          local
  109.  
  110. # wrong item...
  111.     sound    in_itemline0=Inxj089.wav        local # That didn't work.
  112.     sound    in_itemline1=Inxj090.wav        local # ...something wrong.
  113.     sound    in_itemline2=Inxj092.wav        local # Hmm...didn't quite work.
  114.     sound    in_itemline3=Inxj060.wav        local # I don't think...right answer.
  115.     sound    in_itemline4=Inxj087.wav        local # Whoops.
  116.     sound    in_itemline5=Inxj088.wav        local # Nope.
  117.     sound    in_itemline6=Inxj091.wav        local # Of course that didn't work.
  118.  
  119. # wrong spot...
  120.     sound    in_wrongspot0=Inxj219.wav        local # Not lined up right
  121.     sound    in_wrongspot1=Inxj220.wav        local # Need to line up
  122.     sound    in_wrongspot2=Inxj221.wav        local # Need to move over.
  123.     sound    in_wrongspot3=Inxj222.wav        local # Not quite in position.
  124.     sound    in_wrongspot4=Inxj223.wav        local # Need to get in position.
  125.     sound    in_wrongspot5=Inxj224.wav        local # Need to find better spot.
  126.  
  127.  
  128. #...............VECTORS AND POSITION VARS..............
  129.     vector        v_ipyr                                        local
  130.     flex        yaw                                            local
  131.     flex        randlocationlines                            local
  132.     flex        randwrongitemlines                            local
  133.     int            l_newline=50                                local
  134.     int            l_oldline=50                                local
  135.     int            wi_newline=50                                local
  136.     int            wi_oldline=50                                local
  137.     int            cursound                                    local
  138.     int            doplay                                        local
  139.     int            cursound                                    local
  140.     int            speak0                                    local
  141.     int            played=0                                local
  142.  
  143.  
  144. end
  145.  
  146. # ==============================================================================
  147.  
  148. code
  149.  
  150. startup:
  151.  
  152.     # intitialize player
  153.     player = GetLocalPlayerThing();
  154.  
  155.     # anchor the endpoints of the poly line
  156.     AttachThingToThingex(cable_end, elevator, 0x000C);
  157.     
  158.     # lock elevcenter target to the elev
  159.     AttachThingToThingex(elev_INMV1, elevator, 0x000C);
  160.     
  161.     # clear the winch for keyframes
  162.     SetThingFlags(animatedwinch, 0x80000);
  163.     
  164.     # draw the cable for the elevator
  165.     CreatePolylineThing(cable_end, cable_start, '0 0 0', cableskin, 0.0025, 0.0025, 0.0);
  166.     CreatePolylineThing(cable_start, cable_end, '0 0 0', cableskin, 0.0025, 0.0025, 0.0);
  167.  
  168.     # initialize elev kill int
  169.     elev_dir=0;
  170.  
  171.     for (i = 0; i <= 3; i = i + 1)
  172.         {
  173.         AISetCutSceneMode(commie0[i]);
  174.         }
  175.     
  176.     SetMaterialCel(boxfront, 1);
  177.  
  178. return;
  179.  
  180. # ==============================================================================
  181. activated:                 // If player presses button0
  182.     
  183.     If (hit == 1) return;
  184.     
  185.     If (IsMoving(elevator) != 0) return;
  186.     
  187.     If ((GetSenderRef() == button0) && (GetCurFrame(elevator) == 1)) return;
  188.     If ((GetSenderRef() == button0) && (GetCurFrame(elevator) == 0))
  189.     {
  190.         # call from bottom
  191.  
  192.         hit = 1;
  193.         
  194.         if (GetCurItem(player) >= 1)
  195.             {
  196.                 # player is using a wrong item
  197.                 StartCutScene(1);
  198.                 call randwrongitemlines;
  199.                 EndCutscene();
  200.                 hit = 0;
  201.                 return;
  202.             }
  203.         
  204.         # get players' position
  205.         v_ipyr = GetThingLVecPYR(player);
  206.             yaw = VectorY(v_ipyr);
  207.             
  208.             # failure routine and drop out if player has improper pyr
  209.             if ((yaw > 65) || (yaw < -20))
  210.             {
  211.                 StartCutscene(1);
  212.                 call randlocationlines;
  213.                 EndCutscene();
  214.                 hit = 0;
  215.                 return;
  216.             }
  217.  
  218.             
  219.         
  220.         # animate the player
  221.         MakeMeStop();
  222.         DeselectWeaponWait(player);
  223.         PlayMode(player, 60, 1);
  224.         Sleep(0.25);
  225.         PlaySoundLocal(switch, 1, 0, 0, 0);
  226.         SetMaterialCel(boxfront, 0); # green light
  227.         
  228.         # bring the elevator down
  229.         call elev_down;
  230.         
  231.         WaitForStop(elevator);
  232.         Sleep(sleeptime);
  233.         
  234.         # send the elevator up
  235.         call elev_up;
  236.         
  237.         # cutscene style for indy if on the elevator
  238.         call cutscene_up;
  239.         WaitForStop(elevator);
  240.  
  241.         # cutscene release for indy if on the elevator
  242.         If (in_thespot == 1)
  243.             {
  244.             # exit at top...
  245.             SetCameraPosition(1, GetThingPos(topcam));
  246.             SetCurrentCamera(1);
  247.             # restore the player
  248.             TeleportThing(player, indyActor);
  249.             AIClearCutSceneMode(indyActor);
  250.             SetThingFlags(indyActor, 0x80000);
  251.             ClearThingFlags(player, 0x80000);
  252.             SetThingAlpha(player, 1.0);
  253.  
  254.             EndCutScene();
  255.             ClearActorFlags(player, 0x200000);
  256.         }
  257.     }
  258.     
  259.     If ((GetSenderRef() == button1) && (GetCurFrame(elevator) == 1)) return;
  260.     If ((GetSenderRef() == button1) && (GetCurFrame(elevator) == 0))
  261.     {
  262.         # call from top
  263.  
  264.         hit = 1;
  265.         
  266.         if (GetCurItem(player) >= 1)
  267.             {
  268.                 # player is using a wrong item
  269.                 StartCutScene(1);
  270.                 call randwrongitemlines;
  271.                 EndCutscene();
  272.                 hit = 0;
  273.                 return;
  274.             }
  275.         
  276.         
  277.         # get players' position
  278.         v_ipyr = GetThingLVecPYR(player);
  279.             yaw = VectorY(v_ipyr);
  280.             
  281.             # failure routine and drop out if player has improper pyr
  282.             if ((yaw < -167) || (yaw > -73))
  283.             {
  284.                 StartCutscene(1);
  285.                 call randlocationlines;
  286.                 EndCutscene();
  287.                 hit = 0;
  288.                 return;
  289.             }
  290.  
  291.                     
  292.         
  293.         in_thespot = 1;
  294.         # animate the player
  295.         StartCutscene(1);
  296.         MakeMeStop();
  297.         DeselectWeaponWait(player);
  298.         PlayMode(player, 60, 1);
  299.         
  300.         # prep actor
  301.         CopyPlayerHolsters(player, indyActor);
  302.         TeleportThing(indyActor, player);
  303.         AISetCutSceneMode(indyActor);
  304.         SetThingFlags(player, 0x80000);
  305.         ClearThingFlags(indyActor, 0x80000);
  306.         SetThingAlpha(indyActor, 1.0);
  307.         
  308.         # goto cutscene cam
  309.         SetCameraLookInterp(2, 0);
  310.         SetCameraPosInterp(2, 0);
  311.         SetCameraFocus(2, topcam);
  312.         SetCameraSecondaryFocus(2, indyActor);
  313.         SetCurrentCamera(2);
  314.         SetCameraFOV(80, 0, 0.0);
  315.         Sleep(0.25);
  316.  
  317.         PlaySoundLocal(switch, 1, 0, 0, 0);
  318.         SetMaterialCel(boxfront, 0);
  319.         
  320.         # move the actor to the center of the elevator
  321.         rotref=(GetThingMaxRotVel(indyActor));
  322.         SetThingMaxRotVel(indyActor, 150);
  323.         AISetLookThingEyeLevel(indyActor, elev_INMV0);
  324.         Sleep(0.3);
  325.         
  326.         AISetMoveSpeed(indyActor, 1.0);
  327.         AISetMoveThing(indyActor, elev_INMV0, 0);
  328.         Sleep(1.0);
  329.         
  330.         AISetLookThingEyeLevel(indyActor, elev_INMV1);
  331.         AISetMoveThing(indyActor, elev_INMV1, 1);
  332.  
  333.         AISetLookThingEyeLevel(indyActor, elev_INLK0);
  334.         AIWaitForStop(indyActor);
  335.         
  336.         # send the elevator down
  337.         call elev_down;    
  338.         Sleep(3.0);
  339.  
  340.         # cut to bottom cam
  341.         SetCameraFocus(2, bottomcam);
  342.         SetCameraSecondaryFocus(2, indyActor);
  343.         SetCameraFOV(75, 0, 0.0);    
  344.         #Sleep(1.75);
  345.       
  346.         WaitForStop(elevator);
  347.         elev_dir=0;
  348.         
  349.         # restore the player
  350.         TeleportThing(player, indyActor);
  351.         AIClearCutSceneMode(indyActor);
  352.         SetThingMaxRotVel(indyActor, rotref);
  353.         SetThingFlags(indyActor, 0x80000);
  354.         ClearThingFlags(player, 0x80000);
  355.  
  356.         # restore the camera
  357.         v_camspot = VectorAdd(VectorTransformToOrient(player, '0.1 -0.18 0.05'), GetThingPos(player));
  358.         SetCameraPosition(1, v_camspot);
  359.         SetCurrentCamera(1);
  360.         EndCutScene();
  361.         ClearActorFlags(player, 0x200000);
  362.         Sleep(sleeptime);
  363.         
  364.         call elev_up;   
  365.              
  366.         # cutscene style for indy if on the elevator
  367.         call cutscene_up;
  368.  
  369.         WaitForStop(elevator);
  370.  
  371.         # cutscene release for indy if on the elevator
  372.         If (in_thespot == 1)
  373.         {
  374.             SetCameraPosition(1, GetThingPos(topcam));
  375.             SetCurrentCamera(1);
  376.             # restore the player
  377.             TeleportThing(player, indyActor);
  378.             AIClearCutSceneMode(indyActor);
  379.             SetThingFlags(indyActor, 0x80000);
  380.             ClearThingFlags(player, 0x80000);
  381.             SetThingAlpha(player, 1.0);
  382.  
  383.             EndCutScene();
  384.             print("out of cutscenemode");
  385.             ClearActorFlags(player, 0x200000);
  386.         }    
  387.     }
  388.   
  389.     return;
  390.  
  391. # ==============================================================================
  392.  
  393. arrived:
  394.  
  395.     If ((GetSenderRef() == elevator) && (GetCurFrame(elevator) == 0))
  396.         {            
  397.             # at bottom
  398.             SetMaterialCel(boxfront, 1);
  399.             StopKey(animatedwinch, winchKey, 0.0);
  400.             ClearThingFlags(winch, 0x80000);
  401.             SetThingFlags(animatedwinch, 0x80000);
  402.             hit = 0;
  403.         }
  404.  
  405.     If ((GetSenderRef() == elevator) && (GetCurFrame(elevator) == 1))
  406.         {
  407.             # at top
  408.             StopKey(animatedwinch, winchKey, 0.0);
  409.             ClearThingFlags(winch, 0x80000);
  410.             SetThingFlags(animatedwinch, 0x80000);
  411.         }
  412.     return;
  413.  
  414. # ==============================================================================
  415. entered:
  416.  
  417.     If ((GetSenderRef() == elevator) && (GetSourceRef() == player))
  418.     {
  419.         in_thespot = 1;
  420.     }
  421.  
  422.     If ((GetSenderRef() == groundkill) && (GetSourceRef() == player))
  423.     {
  424.         grnd_spot = 1;
  425.     }
  426.  
  427.     return;
  428.  
  429. # ==============================================================================
  430. exited:
  431.  
  432.     If ((GetSenderRef() == elevator) && (GetSourceRef() == player))
  433.     {
  434.         in_thespot = 0;
  435.     }
  436.  
  437.     If ((GetSenderRef() == groundkill) && (GetSourceRef() == player))
  438.     {
  439.         grnd_spot = 0;
  440.     }
  441.  
  442. return;
  443.  
  444. # ==============================================================================
  445. blocked:
  446.  
  447.     
  448.     #if(elev_dir == 0) return;        
  449.     if((GetSenderRef() == elevator) && (grnd_spot == 1))
  450.     {
  451.         If (com_rush == 0)
  452.             {
  453.                 for (i = 0; i <= 3; i = i + 1) 
  454.                 {
  455.                 AttachThingToThingEx(commie0[i], elevator, 0x000C);
  456.                 }
  457.             }
  458.         
  459.         #SetCollideType(elevator, 0);
  460.         DamageThing(player, 1000.0, 0x1, player);
  461.         PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  462.                             
  463.         # Disable and hide player
  464.         #SetThingFlags(player, 0x80000);
  465.         
  466.         # create actor indy
  467.         #deadIndy = CreateThing(tpl_Indy, player);
  468.         #CaptureThing(deadIndy);
  469.                             
  470.         # Show actor Indy and play Keyframe
  471.         #ClearThingFlags(deadIndy, 0x80000);
  472.         #PlayKey(deadIndy, inDie, 4, 0x14, 0);
  473.         #Sleep(1.0);
  474.         #SetCollideType(elevator, 3);
  475.     }
  476.     
  477.     return;
  478.  
  479.  
  480. # ==============================================================================
  481. elev_down:
  482.  
  483.         # move elevator, animate winch
  484.         elev_dir=1;        # elevator down
  485.         MovetoFrame(elevator, 1, speed);
  486.  
  487.         btn_colltype = GetCollideType(button0);
  488.         SetCollideType(button0, 0);
  489.  
  490.         # hide the collision winch, show the animated one
  491.         SetThingFlags(winch, 0x80000);
  492.         ClearThingFlags(animatedwinch, 0x80000);
  493.         winchKey=PlayKey(animatedwinch, winchrun_dn, 4, 0x0, 0);
  494.  
  495.         # cutscene action on first descent...
  496.         If (com_rush == 0)
  497.         {
  498.             StartCutscene(2);
  499.             SetCameraLookInterp(2, 0);
  500.             SetCameraPosInterp(2, 0);
  501.             SetCameraFocus(2, bottomcam);
  502.             SetCameraSecondaryFocus(2, elev_INMV1);
  503.             SetCurrentCamera(2);
  504.             SetCameraFOV(75, 0, 0.0);
  505.  
  506.             # Set up actor
  507.             CopyPlayerHolsters(player, indyActor);
  508.             TeleportThing(indyActor, player);
  509.             AISetCutSceneMode(indyActor);
  510.             SetThingFlags(player, 0x80000);
  511.             ClearThingFlags(indyActor, 0x80000);
  512.             SetThingAlpha(indyActor, 1.0);
  513.             AIEnableHeadTracking(indyActor, elev_INMV1);
  514.             
  515.             # play the music cue
  516.             PlaySoundLocal(terror_cue, 0.5, 0, 0, 0);    
  517.             Sleep(4.25);
  518.  
  519.             #elev_dir = 0;
  520.             #print("elev_dir = 0");
  521.  
  522.             AIDisableHeadTracking(indyActor);
  523.             AISetLookThing(indyActor, elev_INFLEEMK0);
  524.             AISetMoveSpeed(indyActor, 2.5); # run, Indy!
  525.             Sleep(0.3);
  526.             AISetMoveThing(indyActor, elev_INFLEEMK0, 0);
  527.             Sleep(1.0);
  528.  
  529.             for (i = 0; i <= 3; i = i + 1) 
  530.                 {
  531.                 ClearActorFlags(commie0[i], 0x40000);
  532.                 AISetMoveSpeed(commie0[i], 2.5);
  533.                 AISetLookThing(commie0[i], comMV0[i]);
  534.                 AISetMoveThing(commie0[i], comMV0[i], 0);
  535.                 }
  536.             
  537.             Sleep(1.5);
  538.             
  539.             for (i = 0; i <= 3; i = i + 1) 
  540.                 {
  541.                 AIClearCutsceneMode(commie0[i]);
  542.                 AISetFireTarget(commie0[i], player);
  543.                 }
  544.             com_rush = 1;
  545.                 
  546.             # restore the player
  547.             TeleportThing(player, elev_INFLEEMK1);
  548.             AIClearCutSceneMode(indyActor);
  549.             SetThingFlags(indyActor, 0x80000);
  550.             ClearThingFlags(player, 0x80000);
  551.             
  552.             # swing camera back to normal
  553.             v_camspot = VectorAdd(VectorTransformToOrient(player, '-0.1 -0.05 0.0'), GetThingPos(player));
  554.             SetCameraPosition(1, v_camspot);
  555.             SetCurrentCamera(1);
  556.         }
  557.  
  558.         SetCollideType(button0, btn_colltype);
  559.         EndCutscene();
  560.         ClearActorFlags(player, 0x200000);
  561.         elev_dir = 0;
  562.  
  563.     return;
  564.  
  565. # ==============================================================================
  566. elev_up:
  567.  
  568.     elev_dir=0;        # elevator up
  569.     MovetoFrame(elevator, 0, speed);
  570.  
  571.     # hide the collision winch, show the animated one
  572.     SetThingFlags(winch, 0x80000);
  573.     ClearThingFlags(animatedwinch, 0x80000);
  574.     winchKey=PlayKey(animatedwinch, winchrun, 4, 0x0, 0);
  575.  
  576.     return;
  577.  
  578. # ==============================================================================
  579. cutscene_up:
  580.  
  581.     If (in_thespot == 1)
  582.         {
  583.             MakeMeStop();
  584.             StartCutScene(1);
  585.  
  586.             # Set up actor
  587.             CopyPlayerHolsters(player, indyActor);
  588.             TeleportThing(indyActor, player);
  589.             AISetCutSceneMode(indyActor);
  590.             SetThingFlags(player, 0x80000);
  591.             ClearThingFlags(indyActor, 0x80000);
  592.             SetThingAlpha(indyActor, 1.0);
  593.  
  594.             # cut to coverage
  595.             SetCameraLookInterp(2, 0);
  596.             SetCameraPosInterp(2, 0);
  597.             SetCameraFocus(2, bottomcam);
  598.             SetCameraSecondaryFocus(2, indyActor);
  599.             SetCurrentCamera(2);
  600.             SetCameraFOV(80, 0, 0.0);
  601.         
  602.             # move actor to the center of the platform
  603.             rotref=(GetThingMaxRotVel(indyActor));
  604.             SetThingMaxRotVel(indyActor, 150);
  605.             AISetMoveSpeed(indyActor, 1.0);
  606.             AISetLookThingEyeLevel(indyActor, elev_INLK1);
  607.             Sleep(0.3);
  608.             AISetMoveThing(indyActor, elev_INMV1, 1);
  609.             Sleep(3.0);
  610.             
  611.             # cut to top cam
  612.             SetCameraFocus(2, topcam);
  613.             SetCameraSecondaryFocus(2, indyActor);
  614.             SetThingMaxRotVel(indyActor, rotref);
  615.         }
  616.  
  617.     return;
  618.  
  619.  
  620. # ==============================================================================
  621.  
  622. randlocationlines:
  623.  
  624.     while (l_newline == l_oldline)
  625.     {        
  626.         l_newline = RandBetween(0, 5);
  627.     }
  628.     l_oldline = l_newline;
  629.     
  630.     cursound = PlayVoice(player, in_wrongspot0[l_newline], 1, 0);
  631.  
  632.     doplay = Randbetween(0, 2);
  633.     if ((doplay == 0) || (played == 0))
  634.     {
  635.         PlayKey(player, in_bothup, 4, 0x12, 0);
  636.         played = 1;
  637.     }
  638.     WaitForSound(cursound);
  639.  
  640.     return;
  641.  
  642. # ==============================================================================
  643. randwrongitemlines:
  644.  
  645.     while (wi_newline == wi_oldline)
  646.     {        
  647.         wi_newline = RandBetween(0, 19);
  648.         if (wi_newline < 15)
  649.         {    
  650.             wi_newline = RandBetween(0, 3); # ~1/5 chance for lines 0 thru 3
  651.         }
  652.         if (wi_newline == 19)
  653.         {
  654.             wi_newline = 6; # 1/20 chance for line 6 
  655.         }
  656.         if (wi_newline > 16)
  657.         {
  658.             wi_newline = 5; # 1/10 chance for line 5 
  659.         }
  660.         if (wi_newline > 14)
  661.         {
  662.             wi_newline = 4; # 1/10 chance for line 4
  663.         }
  664.     }
  665.     wi_oldline = wi_newline;    
  666.     speak0 = PlayVoice(player, in_itemline0[wi_newline], 1, 1);
  667.     return;
  668.  
  669. # ==============================================================================
  670.  
  671. end
  672.  
  673.  
  674.